package com.api.oa.mapper;

import com.api.oa.model.entity.YQCheckIns;
import com.api.oa.model.vo.OaNoticeVo;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface YQCheckInsMapper {

    @Insert("insert into  yq_check_ins  (" +
            "checkItem," +
            "checkDesc," +
            "createdAt" +
            ") " +
            "values " +
            "(" +
            "#{entity.checkItem}," +
            "#{entity.checkDesc}," +
            "#{entity.createdAt}" +
            ")")
    @Options(useGeneratedKeys = true, keyProperty = "checkId", keyColumn = "id")
    Integer insert(@Param("entity") YQCheckIns entity);


    @Update("update  yq_check_ins  set " +
            "checkId = #{entity.checkId}," +
            "checkItem = #{entity.checkItem}," +
            "checkDesc = #{entity.checkDesc}," +
            "createdAt = #{entity.createdAt}" +
            " where checkId = #{entity.checkId}")
    Integer update(@Param("entity") YQCheckIns entity);


    @Delete("delete from yq_check_ins where checkId=#{id}")
    void delete(@Param("id") Long id);


    @Select("select * from  yq_check_ins ")
    List<YQCheckIns> list(@Param("id") Long pid);


    @Select("select * from  yq_check_ins  where checkId = #{id} limit 1")
    YQCheckIns findOne(@Param("id") Long id);

    @Select("select * from  yq_check_ins ")
    List<YQCheckIns> all();
}

